package com.dzl.partition.dao;

import com.dzl.partition.pojo.WelfarePartition;
import com.dzl.partition.pojo.query.WelfarePartitionQuery;
import com.dzl.partition.pojo.vo.WelfarePartitionVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.dzl.base.mapper.BaseMapper;

import java.util.List;

/**
 * 分区表(WelfarePartition)表数据库访问层
 * @author caobucao
 * @date 2021-05-21 17:34:41
 */
@Repository
public interface WelfarePartitionMapper extends BaseMapper<WelfarePartition> {

    /**
     * 分页查询分区列表
     * @date 2021/5/21 17:43
     * @author caobucao
     * @param query 查询条件
     * @return java.util.List<com.dzl.partition.pojo.vo.WelfarePartitionVo>
     */
    List<WelfarePartitionVo> selectPartitionVoList(WelfarePartitionQuery query);

    /**
     * 分区下拉列表
     * @date 2021/5/21 17:43
     * @author caobucao
     * @param enterpriseId 企业ID
     * @return java.util.List<com.dzl.partition.pojo.vo.WelfarePartitionVo>
     */
    List<WelfarePartitionVo> selectPartitionList(Integer enterpriseId);
    /**
     * 查询分区下关联的商品数量
     * @date 2021/5/24 10:58
     * @author caobucao
     * @param id  id
     * @return java.lang.Integer
     */
    Integer selectCountGoodsById(@Param("id") Integer id);

    /**
     * 查询分区id是否被卡类型关联
     * @date 2021/7/5 15:14
     * @author caobucao
     * @param id  分区id
     * @return java.lang.Integer
     */
    Integer selectCountCardTypeByPartitionId(@Param("id") Integer id);

    /**
     * 根据idList查询
     * @date 2021/8/4 17:38
     * @author caobucao
     * @param partitionIdList 查询条件ids
     * @return java.util.List<com.dzl.partition.pojo.WelfarePartition>
     */
    List<WelfarePartition> selectByIds(@Param("partitionIdList") List<Integer> partitionIdList);
}
